<?php
session_start();


require_once 'lib.php';

class check
{
    public function checkInstall()
    {
       if (file_exists(INSTALL.'install.txt')) {
           return false;
       }
       return true;
    }
    
    public function checkFile()
    {
        
    }
    
    public function checkKey($key=null)
    {
        if ($key != $_SESSION['key']) {
            return false;
        }
        return true;
    }
}

class lib
{
    public function redirect($url)
    {
        header('Location: '.$url);
    }
    
    public function adminRedirect($url)
    {
        $_SESSION['key'] = md5(rand('10000000', '99999999'));
        header('Location: '.$url.'?key='.$_SESSION['key']);
    }
}